package client;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 *
 * @author casshern
 */
public class Information extends JPanel {

    private JLabel label;

    public Information() {
        label = new JLabel();
        label.setPreferredSize(new Dimension(260, 28));

        this.setPreferredSize(new Dimension(280, 110));
        this.setBackground(Color.CYAN);
        this.setBorder(BorderFactory.createTitledBorder("Information"));
        this.setLayout(new GridBagLayout());
        GridBagConstraints c = new GridBagConstraints();
        c.anchor = GridBagConstraints.WEST;
        c.gridwidth = GridBagConstraints.REMAINDER;
        c.insets = new Insets(0, 10, 5, 0);
        this.add(label, c);
    }

    public void setMessage(String text) {
        label.setText(text);
        validate();
    }
}
